<%@ page contentType="text/html; charset=UTF-8" 
import="java.util.*,com.admin.User,com.admin.Role"

%> <% User user=(User)request.getSession().getAttribute("login_user");
    Role role=(Role)request.getSession().getAttribute("user_roles");
 %><%@ taglib prefix="s" uri="/struts-tags" %>
<%
	String path = request.getContextPath();
%><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<head>
        <title>药品生产变更管理平台</title>
         <link rel="icon" href="<%=path%>/images/favicon.ico" type="image/ico">
     <link href="<%=path%>/bgstyle/misc/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
	<link href="<%=path%>/bgstyle/misc/css/bootstrap-modal.css" rel="stylesheet" type="text/css" />
	<link href="<%=path%>/bgstyle/misc/css/joywindow.bootstrap.css" rel="stylesheet" type="text/css" />
	
	<script type="text/javascript" src="<%=path%>/bgstyle/misc/js/jquery-1.7.2.js"></script>
	<script type="text/javascript" src="<%=path%>/bgstyle/misc/js/bootstrap.js"></script>	
	<script type="text/javascript" src="<%=path%>/bgstyle/misc/js/bootstrap-modalmanager.js"></script>	
	<script type="text/javascript" src="<%=path%>/bgstyle/misc/js/bootstrap-modal.js"></script>
	<script type="text/javascript" src="<%=path%>/bgstyle/misc/js/modal.manager.plugin1.0.js"></script>
		<script type="text/javascript" src="<%=path%>/bgstyle/misc/js/jquery.ui.draggable.js"></script>

	<!-- you can delete follow resource 以下两个可删除-->
	<script type="text/javascript" src="<%=path%>/bgstyle/misc/js/form.validate.js"></script>
	<script type="text/javascript" src="<%=path%>/bgstyle/misc/js/jshow.utils.js"></script>	
	
	<script type="text/javascript" src="<%=path%>/bgstyle/misc/other/prettify.js"></script>
	<link href="<%=path%>/bgstyle/misc/other/prettify.css" rel="stylesheet" type="text/css" />


	<!--左侧菜单样式-->
	<style type="text/css">
	/*左侧菜单样式*/
	.sidebar-menu {
		border-radius: 5px;
		border-right: 1px solid #c4c8cb;
	}

	/*一级菜单*/
	.menu-first {
		height: 45px;
		line-height: 45px;
		background-color: #d9d9d9;
		border-top: 1px solid #efefef;
		border-bottom: 1px solid #e1e1e1;
		padding: 0 0 0 20%;
		font-size: 14px;
		color: #556677;
		font-weight: normal;
	}

	/*一级菜单鼠标划过状态*/
	.menu-first:hover {
		text-decoration: none;
		background-color: #a6a4a5;
		border-top: 1px solid #b7b7b7;
		border-bottom: 1px solid #8c8cac;
	}

	/*二级菜单*/
	.menu-second li a {
		background-color: #f6f6f6;
		height: 31px;
		line-height: 31px;
		border-top: 1px solid #efefef;
		border-bottom: 1px solid #efefef;
		font-size: 12px;
	}

	/*二级菜单鼠标划过样式*/
	.menu-second li a:hover {
		text-decoration: none;
		background-color: #66c3ec;
		border-top: 1px solid #83ceed;
		border-bottom: 1px solid #83ceed;
		border-right: 3px solid #f8881c;
	}

	/*二级菜单选中状态*/
	.menu-second-selected a{
		background-color: #66c3ec;
		height: 31px;
		line-height: 31px;
		border-top: 1px solid #83ceed;
		border-bottom: 1px solid #83ceed;
		border-right: 3px solid #f8881c;
	}

	/*覆盖bootstrap的样式*/
	.nav-list {
		padding: 0px;
		margin: 0px;
	}

    .nav-list li a {
		padding: 0 0 2 20%;
		margin: 0px;
	}
	
	
	.pagination ul > li > input{
				vertical-align: top;
			  	-webkit-border-radius: 0;
			     -moz-border-radius: 0;
			          border-radius: 0;
			    height:auto;
				*height: 20px;
				margin-bottom:0px;
				background-color: #fff;
				border-left-width: 0;
				width:40px;
				float:left;
				min-height: auto;
				*min-height: 20px;
	}
		
	input{
		 height:auto;
		 *height: 20px;
	}
	</style>




</head>

<body>

		<div class="navbar  navbar-invers">
			  <div class="navbar-inner">
			  <a class="brand" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
				<ul class="nav" id="title">
				  <s:if test="dhlts != null">
			      <s:iterator value="dhlts" var="dhlt">
			      <li id="<s:property value="#dhlt.Dhid" />" <s:if test="#dhlt.Checked == 1 ">class="active"</s:if>><a  href="<%=path%>/bgmain?Dhid=<s:property value="Dhid"/>"><s:property value="#dhlt.DName" /></a></li>
			       </s:iterator>
                  </s:if>
   				 </ul>
   				 
   				 <ul class="nav pull-right" >
   				  <li><a  href="<%=path%>/logout">退出</a></li>
   				  </ul>
   				</div> 
         </div>


<div class="container-fluid">
	<div class="row-fluid">
		<div class="span12">
			<div class="page-header">
			   
				<h1>药品生产变更管理平台<small><%=user.getUsername()%>,欢迎登陆</small></h1>
				
			</div>
		</div>
	</div>
	
	
	
	<div class="row-fluid">
		<div class="span3">


		<!--Sidebar content start-->
			<div class="sidebar-menu" id="menuslist">
			
				
				
				 <s:if test="dhlMenus != null">
			     <s:iterator value="dhlMenus" var="dhlMenu">
			      
			      
			      
			         <s:if test="#dhlMenu.zmenu.size() != 0">
			         <a href="#<s:property value="#dhlMenu.Url" />" class="nav-header menu-first collapsed" data-toggle="collapse" id="jshow-nav-<s:property value="#dhlMenu.DMid" />">
				   <i class="<s:property value="#dhlMenu.Ico" />"></i><span><s:property value="#dhlMenu.Mname" /></span>
			      </a>
			         <ul id="<s:property value="#dhlMenu.Url" />" class="nav nav-list collapse menu-second">
			         <s:iterator value="#dhlMenu.zmenu" var="zmenu">
			          
			          <li><a href="javascript:;" class="J_Sub_nav" id="<s:property value="#zmenu.DMid" />" url="<%=path%><s:property value="#zmenu.Url" />?DMid=<s:property value="#zmenu.DMid" />" parentid="jshow-nav-<s:property value="#dhlMenu.DMid" />">
							<i class="<s:property value="#zmenu.Ico" />"></i><span><s:property value="#zmenu.Mname" /></span>
						</a>
					</li>
			          
			         </s:iterator>
			         </ul>
			        </s:if>
			          <s:else>
			          <a href="javascript:;" url="<%=path%><s:property value="#dhlMenu.Url" />?DMid=<s:property value="#dhlMenu.DMid" />"   class="nav-header menu-first collapsed J_Sub_nav" data-toggle="collapse" id="jshow-nav-<s:property value="#dhlMenu.DMid" />">
				   <i class="<s:property value="#dhlMenu.Ico" />"></i><span><s:property value="#dhlMenu.Mname" /></span>
			      </a>
			          
			          </s:else>
			      
			       </s:iterator>
                  </s:if>
				
				
				
				
			</div>
		<div id="myModal" data-backdrop="static" data-keyboard="false" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	  <div class="modal-header">
		<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
		<h3 id="myModalLabel" style="font-size:20">Modal header</h3>
	  </div>
	  <div class="modal-body" id="nrbody">
		  
	  </div>
	
	</div>
		<!-- 绑定左侧菜单按钮事件  -->			
		<script>
		void function(j){
		 	j(".J_Sub_nav").click(function(){
		 		var _this=j(this);
				var url=_this.attr('url');
				var parentId=_this.attr('parentId');
				var menuName=_this.find('span').html();
				var parentName=j("#"+parentId).find('span').html();
				j(".J_Sub_nav").parent().removeClass('active');
				_this.parent().addClass('active');
                if(parentName==null){
					gUtils.fUpdateNav(true,'crumb-',menuName);
					//gUtils.fUpdateNav(false,'crumb-'+_this.attr('id'),menuName,url);
				}else{
					gUtils.fUpdateNav(true,'crumb-'+parentId,parentName);
					gUtils.fUpdateNav(false,'crumb-'+_this.attr('id'),menuName,url);
	            } 
	            
              
	            //console.log(url);
	           
				 gUtils.fGetBody(url);
               //gUtils.fGetFrame(url);

			});
		 
		 	
		 	j("#title").children("li").click(function(e){
		       /*  var chooseId = e.currentTarget.id;
		        $(this).addClass("active").siblings("li").removeClass("active");
		        var Dhid = $(this)[0].id;
		        $("#menuslist").html(""); */
		        /* getmenus(Dhid) */
		        
		        var url = "<%=path%>//bgsys/bgmain";
		        
		        
		      });
		 	
		 }(jQuery);
		 
		 function tuichu(){
		    	

		    	location.href = "<%=path%>/logout";

		    		
		    	}

		    setInterval(function() {
		    	sfcs();
		       }, 1801000); 

		    function sfcs(){
		      var online=true;
		    	$.ajax({
		    	        url: "<%=path%>/sfcs",
		    	        data: '',
		    	        type: "Post",
		    	        success: function (result) {
		                if(result=="0"){
		    	    	   online=false;
		                   tuichu();
		                }
		    	    	 return online;
		    	      }
		    		 }); 
		   }
		    
		    var nrbody = "";
		    var title = "";
			 function test(){
		    	
		    	
		    	$('#myModalLabel').html(title);
		    	  
		    	$('#nrbody').html(nrbody);
		    	
		    	
		    	
		    	 $('#myModal').modal('show');  
		    }
		    
		<%--  
		 function getmenus(Dhid){
			
			 $.ajax({
  	            //几个参数需要注意一下
  	                type: "POST",//方法类型
  	                dataType: "json",//预期服务器返回的数据类型
  	                url: "<%=path%>/bg/getmenus" ,//url
  	                data: {
  	                	"Dhid":Dhid,
  	                	 },
  	                success: function (result) {
  	                 let data = result.data;
                     let menus = "";
                     
                     for(var a =0;a<data.length;a++){
                    	
                    	 if(data[a].zmenu!=undefined){
                    		 menus = menus + '<a href="#'+data[a].Url+'" class="nav-header menu-first collapsed" data-toggle="collapse" id="jshow-nav-'+data[a].DMid+'">';
                    		 menus = menus + '<i class="'+data[a].Ico+'"></i><span>'+data[a].Mname+'</span></a>';
          			         menus = menus + '<ul id="'+data[a].Url+'" class="nav nav-list collapse menu-second">';
          			         menus = menus + '<li><a href="javascript:;" class="J_Sub_nav" onclick="method(\'jshow-subnav-'+data[a].zmenu.DMid+'\')" id="jshow-subnav-'+data[a].zmenu.DMid+'" url="'+data[a].zmenu.Url+'" parentid="jshow-nav-'+data[a].DMid+'">';
          			         menus = menus + '<i class="'+data[a].zmenu.Ico+'"></i><span>'+data[a].zmenu.Mname+'</span></a></li>';
          					}else{
          						menus = menus + '<a href="javascript:;" onclick="method(\'<%=path%>'+data[a].Url+'\)" url="<%=path%>'+data[a].Url+'"  class="nav-header menu-first collapsed J_Sub_nav" data-toggle="collapse" id="jshow-nav-'+data[a].DMid+'">';
                       		    menus = menus + '<i class="'+data[a].Ico+'"></i><span>'+data[a].Mname+'</span></a>';
             			    }
                    	 }
                     $("#menuslist").html(menus);
  	                  
  	                 
  	                 

  	                },
  	                error : function(e) {
  	                console.log(e);	
  	                }
  	            });
			 
		 }
		 
		 function method(url,parentId,menuName){
			 
			   
				var url=url;
				var parentId=parentId;
				var menuName=menuName;
				var parentName=$("#"+parentId).find('span').html();
				$(".J_Sub_nav").parent().removeClass('active');
				_this.parent().addClass('active');
				 console.log(parentId,menuName,parentName);
				if(parentName==null){
					gUtils.fUpdateNav(true,'crumb-',menuName);
					//gUtils.fUpdateNav(false,'crumb-'+_this.attr('id'),menuName,url);
				}else{
					gUtils.fUpdateNav(true,'crumb-'+parentId,parentName);
					gUtils.fUpdateNav(false,'crumb-'+_this.attr('id'),menuName,url);
	            }
				 gUtils.fGetBody(url); 
		 } --%>
		
		 
			 
		
		</script>
		<!--Sidebar content end-->

			
		</div>
		
		<!-- content begin -->
		<div class="span9">
		
			<div class="row-fluid">
				<div class="span12">
					<ul class="breadcrumb" id="crumbs">
						<li>
						
						
						
						<s:if test="dhlts != null">
			      <s:iterator value="dhlts" var="dhlt">
			      <s:if test="#dhlt.Checked == 1 "><a href="javascript:;"><s:property value="#dhlt.DName" /></a></s:if>
			       </s:iterator>
                  </s:if>
						
						
						
						<span class="divider">/</span></li>
					</ul>
				</div>
			</div>


			<!--内容区域 start -->
			<div class="row-fluid">
				<div class="span12">
				<div id="main_content">
				  <iframe id="iframe_content"  frameborder="no" border="0" marginwidth="0" marginheight="0"  width="100%" height="100%" src="<%=path%>/bg/syxx"></iframe>
               </div>
			      </div>
			</div>
			<!--内容区域 end -->

			
			
		</div>
		<!-- content end -->
	</div>


		
	<!-- footer 部分 -->	
	<div class="row-fluid">
		<div class="span12"></div>
	</div>
</div>


</body>
</html>